package com.junzhiit.nengji.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum WithdrawalStatus {
	WAIT(0,"申请中"),
	WAITING(1,"银行处理中"),
	SUCCESS(2,"提现成功"),
	FAIL(3,"提现失败");
	
	private Integer value;
	private String text;

	private WithdrawalStatus(Integer value,String text) {
		this.value = value;
		this.text = text;
	}

	public Integer toIntValue() {
		return this.value;
	}
	
	public String toStringText() {
		return this.text;
	}

	public static WithdrawalStatus toText(Integer value) {
		if (WAIT.value == value) {
			return WAIT;
		} else if (WAITING.value == value) {
			return WAITING;
		}else if (SUCCESS.value == value) {
			return SUCCESS;
		}else if (FAIL.value == value) {
			return FAIL;
		}else {
			throw new InvalidArgumentException("Unknown WithdrawalStatus[" + value + "].");
		}
	}
}
